
  (function() {
    var share = document.createElement('script');
    	share.type = 'text/javascript';
    	share.async = true;
    	share.src =	'http://static.bshare.cn/b/buttonLite.js#uuid= 98934489-46b8-45bc-8ba2-21d5597070a1&style=-1';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(share, s);
  })();
  var totalNum=0;
  $(document).ready(function(){
	  function shareTo(event,$id,$target){
//	  bShare.addEntry({
//		    title: "分享的标题，默认为当前页面标题",
//		    url: "分享的链接，默认为当前页面URL",
//		    summary: "分享的文本摘要，默认为页面Meta标签中description的内容或者用户高亮的内容",
//		    pic: "指定分享的图片的链接，目前支持新浪微博，QQ空间，搜狐微博，网易微博，人人网， 嘀咕，腾讯微博和做啥。"
//		});
	  bShare.addEntry({
		    title: getShiTitle($id),
		    url:  getShiUrl($id),
		    summary: getShiSummary($id)
		});
	  bShare.share(event,$target,totalNum++);  
  }
	  
   function getShiTitle($id){
       $title=$(".keyword", $("#word-"+$id));
       
       if($('a',$title))$title=$('a',$title);

	   return $title.html();
  }
   function getShiUrl($id){
	  return $("#word-"+$id).attr('data-url');
  }
   function getShiSummary($id){//alert($id);
	   var box = $(".trans-explanation", $("#word-"+$id));
	   var txt=$(".info",box).text().replace(/^\s+|\s+$/g,"")+"\n";
	   txt+=$(".root",box).text().replace(/^\s+|\s+$/g,"")+"\n";
	   txt+=$(".prefix",box).text().replace(/^\s+|\s+$/g,"")+"\n";
	   txt+=$(".suffix",box).text().replace(/^\s+|\s+$/g,"")+"\n";
       txt = txt .replace(/<br>/g,"\n");
       txt = txt.replace(/^\s+|\s+$/g,"");
       if(txt.length>100){
           txt = txt.substring(0,100)+'...';
       }
       //alert(txt);
       return "\n"+txt+"\n更多访问:";

  }

   $("#content").delegate(".bshare-custom a","click",function(e){
	   $arr=$(this).attr('class').split("-");
	   shareTo(e,$(this).parent().attr('data-id'),$arr[$arr.length-1]);
	   return false;
	 });
 });
